package com.ruoyi.restaurant.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.restaurant.mapper.ResUserMapper;
import com.ruoyi.restaurant.domain.ResUser;
import com.ruoyi.restaurant.service.IResUserService;

/**
 * 用户信息Service业务层处理
 * 
 * @author zhang
 * @date 2023-12-19
 */
@Service
public class ResUserServiceImpl implements IResUserService 
{
    @Autowired
    private ResUserMapper resUserMapper;

    /**
     * 查询用户信息
     * 
     * @param userId 用户信息主键
     * @return 用户信息
     */
    @Override
    public ResUser selectResUserByUserId(Long userId)
    {
        return resUserMapper.selectResUserByUserId(userId);
    }

    /**
     * 查询用户信息列表
     * 
     * @param resUser 用户信息
     * @return 用户信息
     */
    @Override
    public List<ResUser> selectResUserList(ResUser resUser)
    {
        return resUserMapper.selectResUserList(resUser);
    }

    /**
     * 新增用户信息
     * 
     * @param resUser 用户信息
     * @return 结果
     */
    @Override
    public int insertResUser(ResUser resUser)
    {
        resUser.setCreateTime(DateUtils.getNowDate());
        return resUserMapper.insertResUser(resUser);
    }

    /**
     * 修改用户信息
     * 
     * @param resUser 用户信息
     * @return 结果
     */
    @Override
    public int updateResUser(ResUser resUser)
    {
        resUser.setUpdateTime(DateUtils.getNowDate());
        return resUserMapper.updateResUser(resUser);
    }

    /**
     * 批量删除用户信息
     * 
     * @param userIds 需要删除的用户信息主键
     * @return 结果
     */
    @Override
    public int deleteResUserByUserIds(Long[] userIds)
    {
        return resUserMapper.deleteResUserByUserIds(userIds);
    }

    /**
     * 删除用户信息信息
     * 
     * @param userId 用户信息主键
     * @return 结果
     */
    @Override
    public int deleteResUserByUserId(Long userId)
    {
        return resUserMapper.deleteResUserByUserId(userId);
    }
}
